package com.ouyeel.domain;

import java.io.Serializable;
import java.util.Date;

import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.time.DateFormatUtils;
import org.apache.commons.lang3.time.DateUtils;

import java.text.ParseException;

/**
 * Class Name : RfqPreauditSupplierVo.
 * Description : 询报价_资格预审_供应商列表查询实体类.
 * Created by Auto on 2016-05-06.
 */
public class RfqPreauditSupplierVo implements Serializable {

    private static final long serialVersionUID = 1L;

    private String supplierName;    //供应商名称
    private String answerTime;    //报名时间
    private String pasId;    //主键
    private String isSupplier;    //是否为合格供应商（1：是 0：否）
    private String pasDesc;    //审批意见
    private String companyName;    //合格供应商对应的注册公司名称
    private String approvalTime;    //审批时间
    private String supplierCode;    //供应商代码
    private String regcapital;     //注册资本
    private String qualifications;     //拥有资质
    private String answerUserid;    //报名人ID
    private String linkmanName;    //联系人名称
    private String isSpecilInvite;    //是否特邀A
    private String isBindWechat;    //微信状态A
    private String companyId;    //注册公司ID
    private String responseDesc;    //报名详述
    private String recCreateTime;    //记录创建日期
    private String paId;    //资格预审单ID(FK)
    private String linkmanTelphone;    //联系人电话
    private String linkmanTel;    //联系人固定电话
    private String answerUsername;    //报名人名称
    private String martSign;    //市场标识
    private String status;    //状态(值集:A32)0 待审核/1 通过/2 驳回
    private String isSuccess;    //提供给pscs 表示报名信息是否发送成功0：未成功/1：成功

    public String getSupplierName() {
        return supplierName;
    }

    public void setSupplierName(String supplierName) {
        this.supplierName = supplierName;
    }

    public String getAnswerTime() {
        return dateFormat(answerTime);
    }

    public void setAnswerTime(String answerTime) {
        this.answerTime = answerTime;
    }

    public String getPasId() {
        return pasId;
    }

    public void setPasId(String pasId) {
        this.pasId = pasId;
    }

    public String getIsSupplier() {
        return isSupplier;
    }

    public void setIsSupplier(String isSupplier) {
        this.isSupplier = isSupplier;
    }

    public String getPasDesc() {
        return pasDesc;
    }

    public void setPasDesc(String pasDesc) {
        this.pasDesc = pasDesc;
    }

    public String getCompanyName() {
        return companyName;
    }

    public void setCompanyName(String companyName) {
        this.companyName = companyName;
    }

    public String getApprovalTime() {
        return dateFormat(approvalTime);
    }

    public void setApprovalTime(String approvalTime) {
        this.approvalTime = approvalTime;
    }

    public String getSupplierCode() {
        return supplierCode;
    }

    public void setSupplierCode(String supplierCode) {
        this.supplierCode = supplierCode;
    }

    public String getAnswerUserid() {
        return answerUserid;
    }

    public void setAnswerUserid(String answerUserid) {
        this.answerUserid = answerUserid;
    }

    public String getLinkmanName() {
        return linkmanName;
    }

    public void setLinkmanName(String linkmanName) {
        this.linkmanName = linkmanName;
    }

    public String getIsSpecilInvite() {
        return isSpecilInvite;
    }

    public void setIsSpecilInvite(String isSpecilInvite) {
        this.isSpecilInvite = isSpecilInvite;
    }

    public String getIsBindWechat() {
        return isBindWechat;
    }

    public void setIsBindWechat(String isBindWechat) {
        this.isBindWechat = isBindWechat;
    }

    public String getCompanyId() {
        return companyId;
    }

    public void setCompanyId(String companyId) {
        this.companyId = companyId;
    }

    public String getResponseDesc() {
        return responseDesc;
    }

    public void setResponseDesc(String responseDesc) {
        this.responseDesc = responseDesc;
    }

    public String getRecCreateTime() {
        return recCreateTime;
    }

    public void setRecCreateTime(String recCreateTime) {
        this.recCreateTime = recCreateTime;
    }

    public String getPaId() {
        return paId;
    }

    public void setPaId(String paId) {
        this.paId = paId;
    }

    public String getLinkmanTelphone() {
        return linkmanTelphone;
    }

    public void setLinkmanTelphone(String linkmanTelphone) {
        this.linkmanTelphone = linkmanTelphone;
    }

    public String getAnswerUsername() {
        return answerUsername;
    }

    public void setAnswerUsername(String answerUsername) {
        this.answerUsername = answerUsername;
    }

    public String getMartSign() {
        return martSign;
    }

    public void setMartSign(String martSign) {
        this.martSign = martSign;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public String getIsSuccess() {
        return isSuccess;
    }

    public void setIsSuccess(String isSuccess) {
        this.isSuccess = isSuccess;
    }

    public String getLinkmanTel() {
        return linkmanTel;
    }

    public void setLinkmanTel(String linkmanTel) {
        this.linkmanTel = linkmanTel;
    }

    public String getRegcapital() {
        return regcapital;
    }

    public void setRegcapital(String regcapital) {
        this.regcapital = regcapital;
    }

    public String getQualifications() {
        return qualifications;
    }

    public void setQualifications(String qualifications) {
        this.qualifications = qualifications;
    }

    private String dateFormat(String date) {
        String result = "";
        if (StringUtils.isNotBlank(date)) {
            Date newDate = null;
            try {
                newDate = DateUtils.parseDate(date, "yyyy-MM-dd HH:mm:ss.SSS");
            } catch (ParseException e) {
                try {
                    newDate = DateUtils.parseDate(date, "yyyy-MM-dd HH:mm:ss");
                } catch (ParseException e1) {
                    return result;
                }
            }
            result = DateFormatUtils.format(newDate, "yyyy-MM-dd HH:mm:ss");
        } else {
            result = "";
        }
        return result;
    }
}
